3.4.36 \(\int \frac {\cos (c+d x) (B \sec (c+d x)+C \sec ^2(c+d x))}{a+a \sec (c+d x)} \, dx\) [336]

Optimal. Leaf size=35 \[ \frac {B x}{a}-\frac {(B-C) \tan (c+d x)}{d (a+a \sec (c+d x))} \]

[Out]

B*x/a-(B-C)*tan(d*x+c)/d/(a+a*sec(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.079, Rules used = {4157, 4004, 3879} \begin {gather*} \frac {B x}{a}-\frac {(B-C) \tan (c+d x)}{d (a \sec (c+d x)+a)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

(B*x)/a - ((B - C)*Tan[c + d*x])/(d*(a + a*Sec[c + d*x]))

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4004

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a),
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rule 4157

Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(
x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.), x_Symbol] :> Dist[1/b^2, Int[(a + b*Csc[e + f*x])
^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=\int \frac {B+C \sec (c+d x)}{a+a \sec (c+d x)} \, dx\\ &=\frac {B x}{a}-(B-C) \int \frac {\sec (c+d x)}{a+a \sec (c+d x)} \, dx\\ &=\frac {B x}{a}-\frac {(B-C) \tan (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(72\) vs. \(2(35)=70\).
time = 0.15, size = 72, normalized size = 2.06 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (B d x \cos \left (\frac {d x}{2}\right )+B d x \cos \left (c+\frac {d x}{2}\right )+2 (-B+C) \sin \left (\frac {d x}{2}\right )\right )}{a d (1+\cos (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

(Cos[(c + d*x)/2]*Sec[c/2]*(B*d*x*Cos[(d*x)/2] + B*d*x*Cos[c + (d*x)/2] + 2*(-B + C)*Sin[(d*x)/2]))/(a*d*(1 +
Cos[c + d*x]))

________________________________________________________________________________________

Maple [A]
time = 0.69, size = 45, normalized size = 1.29

method result size
derivativedivides \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 B \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(45\)
default \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 B \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(45\)
risch \(\frac {B x}{a}-\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) \(54\)
norman \(\frac {\frac {B x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {B x}{a}-\frac {\left (B -C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(102\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(-B*tan(1/2*d*x+1/2*c)+C*tan(1/2*d*x+1/2*c)+2*B*arctan(tan(1/2*d*x+1/2*c)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (35) = 70\).
time = 0.51, size = 73, normalized size = 2.09 \begin {gather*} \frac {B {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + \frac {C \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

(B*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - sin(d*x + c)/(a*(cos(d*x + c) + 1))) + C*sin(d*x + c)/(a*(co
s(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 3.56, size = 44, normalized size = 1.26 \begin {gather*} \frac {B d x \cos \left (d x + c\right ) + B d x - {\left (B - C\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

(B*d*x*cos(d*x + c) + B*d*x - (B - C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+a*sec(d*x+c)),x)

[Out]

(Integral(B*cos(c + d*x)*sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*cos(c + d*x)*sec(c + d*x)**2/(sec(c
+ d*x) + 1), x))/a

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 44, normalized size = 1.26 \begin {gather*} \frac {\frac {{\left (d x + c\right )} B}{a} - \frac {B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*B/a - (B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1/2*c))/a)/d

________________________________________________________________________________________

Mupad [B]
time = 2.82, size = 32, normalized size = 0.91 \begin {gather*} -\frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a}-\frac {B\,d\,x}{a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)*(B/cos(c + d*x) + C/cos(c + d*x)^2))/(a + a/cos(c + d*x)),x)

[Out]

-((tan(c/2 + (d*x)/2)*(B - C))/a - (B*d*x)/a)/d

________________________________________________________________________________________